package com.wanxi.model;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.wanxi.util.IdJsonSerialize;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.annotations.Setting;

import java.io.Serializable;
import java.math.BigDecimal;
/**
 * @author 杨金乾
 */
@Data
@Document(indexName = "product")
@Setting(shards = 1,replicas = 1)
public class ProductModel implements Serializable {
    @JsonSerialize(using = IdJsonSerialize.class)
    @Id
    private Long id;
    private String createTime;
    private String createTimeStart;
    private String createTimeEnd;
    private String updateTime;
    private String updateTimeStart;
    private String updateTimeEnd;
    @Field(type = FieldType.Integer,name = "enable")
    private Integer enable;
    private String remark;
    private Integer page;
    private Integer limit;
    @Field(analyzer="ik_max_word",type = FieldType.Text,name = "name")
    private String name;
    @Field(type = FieldType.Double,name = "price")
    private BigDecimal price;
    private BigDecimal priceStart;
    private BigDecimal priceEnd;
    @Field(analyzer="ik_max_word",type = FieldType.Text,name = "content")
    private String content;
    @Field(type = FieldType.Integer,name = "isShow")
    private Integer isShow;
    @Field(type = FieldType.Integer,name = "isRecommend")
    private Integer isRecommend;
    @Field(type = FieldType.Text,name = "imgHref")
    private String imgHref;
    @Field(type = FieldType.Integer,name = "whereShow")
    private Integer whereShow;
    @JsonSerialize(using = IdJsonSerialize.class)
    @Field(type = FieldType.Long,name = "clothingStyleId")
    private Long clothingStyleId;
    @Field(analyzer="ik_max_word",type = FieldType.Text,name = "clothingStyleName")
    private String  clothingStyleName;
}
